#ifndef     GRAPHICCOMPONENT_H_
# define    GRAPHICCOMPONENT_H_

# include <SFML/Graphics.hpp>
# include <string>
# include "../vector.h"
# include "MainGraphic.h"

class GraphicComponent
{
public:
    GraphicComponent(MainGraphic & mg) : _mg(mg) {}
    GraphicComponent(GraphicComponent & oth) : _mg(oth._mg) {}
    ~GraphicComponent();

    void init(std::string const & filename);
    void setPos(vector const & pos);
    void setSubRect(vector const & pos, vector const & size);
    void freeGC();

    MainGraphic & getMG() { return _mg; }
    void flip(bool f) { _sprite->FlipX(f); }

    virtual void Set_Statut(std::string statut){}
    virtual sf::Sprite Update(){return sf::Sprite();}

private:
    MainGraphic & _mg;
    std::string   _img;
    sf::Sprite  * _sprite;
};

#endif   /* GRAPHICCOMPONENT_H_ */
